﻿namespace IBTrader.Modules.Read
{
    using IBTrader.Modules.Binarize;
    using IBTrader.Modules.Market;
    using System;
    using System.IO;

    class ReaderDailyTickData : Reader
    {
        protected override int LineSize { get { return sizeof(int) + sizeof(byte) + sizeof(float); } }
        protected override IBinarizer Binarizer { get { return new BinarizerDailyTick(); } }

        protected override void Do(BinaryReader reader, DateTime date, double price)
        {
            var tickType = (TickType)reader.ReadByte();
            Add(tickType, date, price);
        }
    }
}
